<!DOCTYPE html> 
<html>
  <head>
    <title>XNA Platformer Starter Kit</title>
    
    <link rel="stylesheet" href="../Common/browser.css">
    <link rel="stylesheet" href="platformer.css">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
  </head>
  <body onload="onLoad()">
    <script type="text/javascript">
      var jsilConfig = {
        printStackTrace: false,
        webgl2d: true,
        xna: 4,
        gamepad: true,
        readOnlyStorage: true,
        localStorage: true,
        
        manifests: [
          "Platformer.exe",
          "Content/Content.contentproj"
        ],
        
        showProgressBar: true,
        showStats: true,

        scriptRoot: "",
        libraryRoot: "../Libraries/",
        fileRoot: "Content/",
        contentRoot: "Content/"      
      };
    </script>
    <script src="../Libraries/JSIL.js" type="text/javascript"></script>    
    
    <canvas id="canvas" width="800" height="480">
    </canvas><br>
    <div id="welcomeMessage">
      <p align="center"><a href="http://jsil.org/"><img src="http://jsil.org/images/jsil_48px.png" alt="JSIL logo" border="0"></a></p>
      <p>This demo is the XNA 4 Platformer Starter Kit, compiled from C# to JavaScript using <A href="http://jsil.org/">JSIL, my open-source C# to JavaScript compiler</a>. It should run in any browser that supports HTML5 and a modern version of JavaScript, no plugins required.</p>
      <p align="center">To begin playing, click the <b>Load Game</b> button below.</p>
    </div>
    <button id="loadButton">Load Game</button>
    <div id="log"><center><i>Arrow keys to move. Space to jump.</i></center><br></div>
    
    <script type="text/javascript">
      var assetsToLoad = [
        ["File", "Levels/0.txt"],
        ["File", "Levels/1.txt"],
        ["File", "Levels/2.txt"],
      ];
            
      function runMain () {
        try {
          document.getElementById("welcomeMessage").setAttribute("style", "display: none");
        } catch (ex) {
        }

        // We can't invoke Main() since it disposes the Game immediately, breaking everything.
        var asm = JSIL.GetAssembly("Platformer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
        var game = new asm.Platformer.PlatformerGame();
        game.Run();
      };
    </script>
    <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-6375004-2']);
    _gaq.push(['_setDomainName', '.luminance.org']);
    _gaq.push(['_trackPageview']);

    (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>
  </body>
</html>
